package router.message;

import java.io.Serializable;

/**{@link Message} describe a message sendable by the ZerdNet library
 * @author Zerdligham
 */
public abstract class Message implements Serializable, Cloneable {
	private static final long serialVersionUID = -2160699625146026153L;
	protected MessageID dest;
	
	/**Creates a new message with a give content
	 * @param content message content
	 */
	public Message(MessageID dest) {
		super();
		this.dest = dest;
	}
	
	/**Creates a new message with a give content
	 * @param content message content
	 */
	public Message(int fullID) {
		this(new MessageID(fullID));
	}
	
	/**Creates a new message with a give content
	 * @param content message content
	 */
	public Message(int deviceID, int compID) {
		this(new MessageID(deviceID, compID));
	}
	
	
	@Override
	public String toString() {
		return "Message" + dest.toString() + "[]";
	}

	public MessageID getDest() {
		return dest;
	}

	@Override
	public abstract Message clone() throws CloneNotSupportedException;
	
}
